/**
 * 
 * @Project le cOeur - Data Virtualization
 * @Date 27.11.2012
 * @Author Aebi Pascal, Kocher Marc
 * @School BFH-TI Biel, Bachelor Thesis
 *
 */

package main.framework.resource;

/**
 * This class represents a resource URI node object.
 */
public class ResourceURINode {

	private String uriNode;
	private ResourceURINode next = null;
	private ResourceURINode prev = null;
	
	/**
	 * Creates a resource URI node.
	 * 
	 * @param uriNode The name of the URI node.
	 */
	public ResourceURINode(String uriNode) {
		this.uriNode = uriNode;
	}

	/**
	 * Gets the next resource URI node.
	 * 
	 * @return The next resource URI node.
	 */
	public ResourceURINode getNext() {
		return this.next;
	}

	/**
	 * Sets the next resource URI node.
	 * 
	 * @param next The next resource URI node.
	 */
	public void setNext(ResourceURINode next) {
		this.next = next;
	}

	/**
	 * Gets the previous resource URI node.
	 * 
	 * @return The previous resource URI node.
	 */
	public ResourceURINode getPrev() {
		return this.prev;
	}

	/**
	 * Sets the previous resource URI node.
	 * 
	 * @param prev The previous resource URI node.
	 */
	public void setPrev(ResourceURINode prev) {
		this.prev = prev;
	}
	
	/**
	 * Gets the URI node.
	 * 
	 * @return The URI node.
	 */
	public String getUriNode() {
		return this.uriNode;
	}

	/**
	 * Checks if a given resource URI node equals this one.
	 * 
	 * @param resourceURINode The given resource URI node to compare with.
	 * @return True if given resource URI node equals this one, false if not.
	 */
	public boolean equals(ResourceURINode resourceURINode) {
		if(this.uriNode.equalsIgnoreCase(resourceURINode.getUriNode())){
			return true;
		}
		else{
			return false;
		}
	}

	public String toString() {
		return this.uriNode;
	}

}